-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CORE-538] Address nit and fix Cosmos 0.50 post merge conflict #922
Conversation
Warning Rate Limit Exceeded@lcwik has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 22 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the @coderabbitai review command. Alternatively, push new commits to this PR. We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent update involves a modification to the handling of messages in a Cosmos SDK-based application. A key function, Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit's AI:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
// Validate returns an error if one of the underlying msgs fails `ValidateBasic`. | ||
func (omt *OtherMsgsTx) Validate() error { | ||
// Note that with Cosmos SDK 0.50.0 ValidateBasic has been removed from SDK message types, | ||
// and it is recommended that users simulate the transaction instead to ensure that it could be | ||
// processed. | ||
for _, msg := range omt.msgs { | ||
if m, ok := msg.(sdk.HasValidateBasic); ok { | ||
if err := m.ValidateBasic(); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Validate
method's comments indicate that ValidateBasic
has been removed from SDK message types in Cosmos SDK 0.50.0, and transaction simulation is recommended instead. However, the code still checks for sdk.HasValidateBasic
and calls ValidateBasic
if available. This could lead to confusion and should be clarified or updated to reflect the new recommended practice.
- if m, ok := msg.(sdk.HasValidateBasic); ok {
- if err := m.ValidateBasic(); err != nil {
+ // if m, ok := msg.(sdk.HasValidateBasic); ok {
+ // if err := m.ValidateBasic(); err != nil {
+ // return getValidateBasicError(msg, err)
+ // }
+ // }
+ // TODO: Implement transaction simulation as per Cosmos SDK 0.50.0 recommendations
Committable suggestion
❗ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
// Validate returns an error if one of the underlying msgs fails `ValidateBasic`. | |
func (omt *OtherMsgsTx) Validate() error { | |
// Note that with Cosmos SDK 0.50.0 ValidateBasic has been removed from SDK message types, | |
// and it is recommended that users simulate the transaction instead to ensure that it could be | |
// processed. | |
for _, msg := range omt.msgs { | |
if m, ok := msg.(sdk.HasValidateBasic); ok { | |
if err := m.ValidateBasic(); err != nil { | |
// Validate returns an error if one of the underlying msgs fails `ValidateBasic`. | |
func (omt *OtherMsgsTx) Validate() error { | |
// Note that with Cosmos SDK 0.50.0 ValidateBasic has been removed from SDK message types, | |
// and it is recommended that users simulate the transaction instead to ensure that it could be | |
// processed. | |
for _, msg := range omt.msgs { | |
// if m, ok := msg.(sdk.HasValidateBasic); ok { | |
// if err := m.ValidateBasic(); err != nil { | |
// return getValidateBasicError(msg, err) | |
// } | |
// } | |
// TODO: Implement transaction simulation as per Cosmos SDK 0.50.0 recommendations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 0
Configuration used: CodeRabbit UI
Files selected for processing (1)
- protocol/x/ratelimit/types/expected_keepers.go (1 hunks)
Additional comments: 1
protocol/x/ratelimit/types/expected_keepers.go (1)
- 10-10: The change from
sdk.Context
tocontext.Context
in theGetSupply
method signature will require all implementers of theBankKeeper
interface to update their method implementations to use the standard Gocontext
. Ensure that all implementations of this interface have been updated accordingly.
Changelist
[CORE-538] Address nit and fix post Cosmos 0.50 merge conflict
Test Plan
Existing tests
Author/Reviewer Checklist
state-breaking
label.indexer-postgres-breaking
label.PrepareProposal
orProcessProposal
, manually add the labelproposal-breaking
.feature:[feature-name]
.backport/[branch-name]
.refactor
,chore
,bug
.